package com.jinlia.show.modules.base.model.po;

import com.jinlia.show.modules.base.system.entity.Goods;
import com.jinlia.show.modules.base.system.entity.OrderItem;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class OrderItemPO extends OrderItem {

    private Goods goods;
    /**
     * 订单项(商品)的佐料信息
     */

    public static OrderItemPO fromEntity(OrderItem entity) {
        OrderItemPO vo = new OrderItemPO();
        BeanUtils.copyProperties(entity, vo);
        return vo;
    }

    public static OrderItem toEntity(OrderItemPO vo) {
        OrderItem entity = new OrderItem();
        BeanUtils.copyProperties(vo, entity);
        return entity;
    }
}
